function async(callback){
    console.log("before timeout:");
    callback();
    setTimeout(function(){
        callback();
    },500);
}

var color = "green";
async(function(){
    console.log("the color is : " + color);
});

color = "blue";
console.log("after change color, the color is :" + color);


var shape = "circle";
(function(shape){
    async(function(){
        console.log("the shape is : " + shape);
    });
})(shape);
// making shape an argument for the anonymous function,
// the value of shape becomes locale to the scope of this anonymous function.

shape = "triangle";
console.log("after change shape, the shape is :" + shape);